package pl.sedek.com;

import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.apache.log4j.Logger;


/**
 * 
 * @author Lukasz
 *
 */
@Path("/trasa")
public class TrasaResource {

	@GET
	@Path("{id}")
	@Produces( { MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
	public Trasa getTrasa(@PathParam("id")int id, @HeaderParam("username") String login, @HeaderParam("password") String haslo) {

		Logger log = Logger.getLogger(TrasaResource.class);
		log.info("user = " + login);
		log.info("pass = " + haslo);
		Trasa t = new Trasa(id, login, haslo);
		t.setUser(new User(login, haslo, "mail"));

		return t;
		
	}

}